- Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathHashTableClient.java
39 lines (31 loc) Β· 886 Bytes
/
HashTableClient.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
packagesection16_Hashmap;
publicclassHashTableClient {
publicstaticvoidmain(String[] args) throwsException {
HashTable<String, Integer> map = newHashTable<>(4);
map.put("USA", 1000);
map.put("Nepal", 50);
map.put("India", 200);
map.put("India", 300);
// map.put("Canada", 600);
map.display();
System.out.println();
map.put("Germany", 500);
map.put("Nepal", 5000);
map.put("Korea", 290);
// System.out.println();
map.display();
// System.out.println();
// System.out.println(map.get("Nepal"));
// System.out.println(map.get("USA"));
// System.out.println(map.get("Hongkong"));
// map.display();
//
// System.out.println();
// System.out.println("removed: " + map.remove("India"));
// System.out.println();
// map.display();
// System.out.println("removed: " + map.remove("Germany"));
// System.out.println();
// map.display();
}
}